#include<iostream>
using namespace std;
 int main(){
 	unsigned long n,k,test=1;
 	char c[65];
	cin>>n>>k; 	
 	test=test<<(n-1);
 	int c_index=0,p_index=1,r=1;
 	while(test){
		cout<<"test"<<test<<endl; 		
		cout<<"index"<<c_index<<endl;		
 		if(test&k){
 			r=r*2; 
 			if(r%4==2||r%4==3){c[c_index]='1';}
 			cout<<"index:"+c_index<<" c[]="<<c[c_index]<<endl;
		 }else{
		 	r=r*2-1;
 			if(r%4==1||r%4==0){c[c_index]='0';}		 	
 			cout<<"index:"+c_index<<" c[]="<<c[c_index]<<endl;
		 }
		c_index++; 
		c[c_index]=0;
 		test=test>>1;
	}
	for(int i=0;i<n;i++){
		cout<<n<<c[i];
	}
 }
